package com.miplus.ccrm.core.service.iou;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.yulichang.base.MPJBaseServiceImpl;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.miplus.ccrm.core.controller.vo.iou.IBillResVo;
import com.miplus.ccrm.core.controller.vo.iou.IPayDetailReqVo;
import com.miplus.ccrm.core.controller.vo.iou.IPayDetailResVo;
import com.miplus.ccrm.core.controller.vo.iou.IPayPlanResVo;
import com.miplus.ccrm.core.pojo.IouBill;
import com.miplus.ccrm.core.pojo.IouBillPaydetail;
import com.miplus.ccrm.core.mapper.IouBillPaydetailMapper;
import com.miplus.ccrm.core.pojo.IouBillPayplan;
import org.springframework.stereotype.Service;

/**
* @author pc
* @description 针对表【IOU_BILL_PAYDETAIL(借据还款明细表)】的数据库操作Service实现
* @createDate 2024-10-26 12:45:25
*/
@Service
public class IouBillPaydetailServiceImpl extends MPJBaseServiceImpl<IouBillPaydetailMapper, IouBillPaydetail>
    implements IouBillPaydetailService{

    @Override
    public IPage<IPayDetailResVo> caseList(IPayDetailReqVo paras)
    {
        return selectJoinListPage(new Page<>(paras.getPageNum(), paras.getPageSize()),
                IPayDetailResVo.class,
                new MPJLambdaWrapper<IouBillPaydetail>()
                        .selectAs("fun_getnames('FI.REPAY.STATUS',t.status)", IPayDetailResVo::getStatusdsc)
                        .selectAs("fun_getnames('FI.REPAY.OTYPE',t.repay_operator_tpye)", IPayDetailResVo::getRepayOperatorTpyedsc)
                        .selectAll(IouBillPaydetail.class)
                        .eq(IouBillPaydetail::getBillid,paras.getBillno())
                        .orderByAsc(IouBillPaydetail::getCrdt)
        );
    }
}




